Skip to content

Conversation

@raseltechnext
Copy link
Collaborator

Summary

  • What does this PR do?

Changes

How to test

Screenshots (if UI)

Checklist

  • PR title is semantic (e.g., feat: add X, fix: correct Y)
  • Linked issue (Fixes #ID)
  • Lint passes locally (pnpm lint)
  • Build pass locally (server: pnpm --filter server test)
  • Includes migrations or schema changes (if any) documented
  • Updated docs/changelog if needed

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the signup form by moving authentication logic from the parent page component into the SignupForm component itself. This change makes the SignupForm self-contained and directly handles user registration and navigation.

Key changes:

  • Moved authClient.signUp.email() logic from the page component into SignupForm's onSubmit handler
  • Removed the handleSignup prop from SignupForm interface, making it self-sufficient
  • Added router-based navigation on successful signup
  • Removed the 'use client' directive from the page component (no longer needed since it doesn't use client-side hooks)

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
apps/client/src/components/sections/authentications/default/SignupForm.tsx Internalized signup logic, added router navigation, reorganized imports, and updated Button props formatting
apps/client/src/app/auth/signup/page.tsx Simplified to a presentational component by removing client-side logic and the handleSignup function

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +66 to +70
if (signupData) {
router.push(rootPaths.root);
}
if (error) {
setError('root.credential', { type: 'manual', message: error.message });
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both success and error conditions can be true simultaneously if signupData exists but error is also present. These should be mutually exclusive using else-if logic to prevent navigating away while also setting an error.

Suggested change
if (signupData) {
router.push(rootPaths.root);
}
if (error) {
setError('root.credential', { type: 'manual', message: error.message });
if (error) {
setError('root.credential', { type: 'manual', message: error.message });
} else if (signupData) {
router.push(rootPaths.root);

Copilot uses AI. Check for mistakes.
router.push(rootPaths.root);
}
if (error) {
setError('root.credential', { type: 'manual', message: error.message });
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential null reference error if error.message is undefined. The error object should be checked for the existence of the message property before accessing it, or provide a fallback error message.

Suggested change
setError('root.credential', { type: 'manual', message: error.message });
setError('root.credential', { type: 'manual', message: error?.message ?? "An unknown error occurred." });

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sshahriazz sshahriazz merged commit 8fdd413 into main Nov 12, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Complete signup with email and password with proper redirections setup

3 participants